package com.herui.iot.ui.evaluation;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.util.Log;

import com.alibaba.fastjson.JSON;
import com.herui.sport_care.R;
import com.herui.sport_care.config.AppConfig;
import com.herui.sport_care.data.SimDataFactory;
import com.herui.sport_care.data.eval.EvalInfo;
import com.herui.sport_care.ui.BaseSportActivity;
import com.herui.sport_care.ui.evaluation.execute.EvalChoseFragment;

public class EvalActivity extends BaseSportActivity {


    private EvalInfo evalInfo;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        String info = getIntent().getStringExtra("evalInfo");
        evalInfo = JSON.parseObject(info, EvalInfo.class);
        if (AppConfig.DeviceDebug){
            evalInfo = SimDataFactory.getEvalInfo();
        }
        Log.d(TAG, "onCreate: "+evalInfo);
    }

    @Override
    public int getLayout() {
        return R.layout.activity_eval;
    }

    @Override
    public void initParam() {
        add(EvalChoseFragment.newInstance(evalInfo), null);
    }

    @Override
    public int getContent() {
        return R.id.content;
    }
}